package com.atguigu.scala.chapter_04

object Scala_For {
  def main(args: Array[String]): Unit = {
    for (i <- 1 to 5) {
      println(s"i=$i")
    }
    println("---------------------------------------")
    for (i <- Range(1, 5, 2)) {
      println(s"i=$i")
    }
    println("---------------------------------------")
    for (i <- 1 until 5) {
      println(s"i=$i ")
    }
    println("---------------------------------------")
    for (i <- Range(0, 5)) {
      println(s"i=$i")

    }
    println("---------------------------------------")
    for (i <- 1 until 5) {
      println(i)
    }
    println("---------------------------------------")
    for (i <- Range(1, 5) by 2) {
      println(i)

    }
    println("---------------------------------------")
        for (i <- Range(1, 5) if i !=3) {
          println(i)

        }
  }

}
